<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
    <meta charset="utf-8">
    <title>绝对定位</title>
    <style media="screen">
        .container {
            position: relative;
        }

        .main,
        .left,
        .right {
            min-height: 200px;
        }

        .main {
            background: yellow;
            padding: 0 200px 0 300px;
        }

        .left {
            position: absolute;
            left: 0;
            width: 300px;
            background: red;
            top: 0;
        }

        .right {
            position: absolute;
            right: 0;
            width: 200px;
            background: gray;
            top: 0;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="main">
            中间部分
        </div>
        <div class="left">
            左边
        </div>
        <div class="right">
            右边
        </div>
    </div>

</body>

</html>